QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Using Access Keys

This section explains how to use access keys.

Registering an Access Key

Listing 14 illustrates how to register an application access key.

Listing 14 Registering an application access key

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = AccessKeySystemFlag;
handle keyHdl;

myErr = PtrToHand ((Ptr)"keykeykey", &keyHdl, sizeof("keykeykey")-1);
myErr = QTRegisterAccessKey (keyType, flags, keyHdl);

Listing 15 illustrates how to register a system access key.

Listing 15 Registering a system access key

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = 0;
handle keyHdl;

myErr = PtrToHand ((Ptr)"keykeykey", &keyHdl, sizeof("keykeykey")-1);
myErr = QTRegisterAccessKey (keyType, flags, keyHdl);

Unregistering an Access Key

Listing 16 illustrates how to unregister a system access key.

Listing 16 Unregistering an access key

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = AccessKeySystemFlag;
handle keyHdl;

myErr = PtrToHand ((Ptr)"keykeykey", &keyHdl, sizeof("keykeykey")-1);
myErr = QTUnRegisterAccessKey (keyType, flags, keyHdl);

Getting Access Keys

Listing 17 illustrates how a decompressor can get application access keys of a particular type.

Listing 17 Getting access keys

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = 0;
handle keyHdl;

myErr = PtrToHand ((Ptr)"keykeykey", &keyHdl, sizeof("keykeykey")-1);
myErr = QTGetAccessKeys (keyType, flags, keyHdl);

Using Controls for Access Keys in the QuickTime Control Panel

Users can enter, edit, and delete system access keys in the QuickTime control panel. The controls for these operations are illustrated in Figure 10 , Figure 11 , and Figure 12 .

Figure 10 Click the Add button to add an access key

Figure 11 Next, enter the category (key type) and key, then click OK

Figure 12 When you're done, there's a key that can be edited or modified


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next